#import <Foundation/Foundation.h>

#import "Array.m"
#import "ASMacro.h"

@interface Item : NSObject
@end
@implementation Item
@end

int main(){
	NSAutoreleasePool *pool = [[NSAutoreleasePool alloc] init];

	Array *aa = as3new(Array);
	Item *item = as3new(Item);
	Item *item2= as3new(Item);
	Item *item3= as3new(Item);
	Item *item4= as3new(Item);
	
	NSLog(@"item  %@",item);
	NSLog(@"item2 %@",item2);
	
	NSLog(@"indexOf item  %i", [aa indexOf:item]);
	
	[aa push:item];
/*	[aa push:item2];
	[aa push:item3];
	[aa push:item4];*/
	
	[aa push:item2 :item3,item4,nil];
	NSLog(@"---------------------");
	NSLog(@"array length  %i", aa.length);
	NSLog(@"indexOf item  %i", [aa indexOf:item]);
	NSLog(@"indexOf item2 %i", [aa indexOf:item2]);
	
	NSLog(@"join: %@", [aa join]);
	
	NSLog(@"lastIndexOf item  %i", [aa lastIndexOf:item]);
	NSLog(@"lastIndexOf item2 %i", [aa lastIndexOf:item2]);
	
	NSLog(@"%@",[aa join]);
	[aa reverse];
	NSLog(@"%@",[aa join]);
	
	NSLog(@"shift %@", [aa shift]);
	NSLog(@"%@", [aa toString]);
	
	NSLog(@"slice %@", aa);
	Array *bb = [aa slice:0 endIndex:5];
	NSLog(@"slice %@", bb);
	NSLog(@"array b %@", [bb join]);

	NSLog(@"pop %@",[aa pop]);
	NSLog(@"pop %@",[aa pop]);
	NSLog(@"pop %@",[aa pop]);
	NSLog(@"---------------------");	
	NSLog(@"%i",[aa length]);
	
	Array *cc = as3new(Array);
	
	[cc push:@"Bill"];
	[cc push:@"Jeff"];
	
	NSLog(@"names: %@",[cc join]); // Bill,Jeff
	
	[cc unshift:@"Alfred" :@"Kyle",@"Leo",nil];
//	[cc unshift:@"Kyle"];
	
	NSLog(@"names: %@",[cc join]); // Kyle,Alfred,Bill,Jeff
	
	[aa release];
	[cc release];
	[item release];
	[item2 release];
	[item3 release];
	[item4 release];
	
	[pool release];
	return 0;
}